package lohr.lang.dom;


public class MethodInvocation extends Expression {
	private ReferenceExpression _target;
	private IdentifierName _name;
	private Arguments _arguments;

	public MethodInvocation(ReferenceExpression target, IdentifierName name, Arguments args) {
		addChild(_target= target);
		addChild(_name= name);
		addChild(_arguments= args);
	}

	public ReferenceExpression getTarget() {
		return _target;
	}

	public IdentifierName getMethodIdentifier() {
		return _name;
	}

	public Arguments getArguments() {
		return _arguments;
	}
	
	@Override
	public String toString() {
		String s= "";
		if (_target != null) {
			s= _target.toString()+".";
		}
		s+= _name;
		if (_arguments != null) {
			s+= "("+_arguments.toString()+")";
		}
		return s;
	}
}
